import { PlayerDialog } from "./PlayerDialog";
import { ObjectPool } from "../../../../../com/gengine/utils/pools/ObjectPool";
import { OperateItem } from "./OperateItem";
//class OperateList2
    
    export  class OperateList2 extends PlayerDialog
    {
        constructor()
        {
            super();
            this._bodySp = new Object /* flash.display.Sprite */();
            this.addChild(this._bodySp);
            return;
        }

        public /* override */ updateData(arg1: Array<any>): void
        {
            var loc3=null;
            var loc4=null;
            var loc1=0;
            var loc2=arg1.length;
            while (loc1 < loc2) 
            {
                loc3 = arg1[loc1];
                (loc4 = ObjectPool.getObject(OperateItem)).updateData(loc3);
                loc4.x = loc1 % 2 * 120;
                loc4.y = Math.floor(loc1 / 2) * 20;
                this._bodySp.addChild(loc4);
                ++loc1;
            }
            super.updateData(arg1);
            return;
        }

        public /* override */ dispose(): void
        {
            var loc1=null;
            super.dispose();
            while (this._bodySp.numChildren > 0) 
            {
                loc1 = this._bodySp.getChildAt(0) as OperateItem;
                this._bodySp.removeChild(loc1);
                loc1.dispose();
                ObjectPool.disposeObject(loc1, OperateItem);
            }
            return;
        }

        public /* override */ get height(): number
        {
            var loc1=0;
            var loc3=null;
            var loc4=0;
            var loc2=this._bodySp.numChildren;
            while (loc1 < loc2 && loc1 % 2 == 0) 
            {
                loc3 = this._bodySp.getChildAt(loc1);
                loc4 = loc4 + loc3.height;
                ++loc1;
            }
            return loc4;
        }

        /* internal */ /* var */_bodySp: Object /* flash.display.Sprite */;
    }
